Fimex is a library and a program to convert gridded geospatial data
between different formats and projections.


DEPENDENCIES
------------
Fimex requires at least the following libraries to be installed for
compilation
	* c99/c++ compiler
	* libxml2 >= 2.5.0
	* boost library >= 1.32 (1.33 for running tests)
    * proj-4 >= 4.4.9
	
To configure the different file formats it requires:
    * NetCDF (netcdf-3 > 3.6)
    * Felt (libmi)

Optional packages:
    * udunits (> 1.12)
        

INSTALLATION
------------
The installation follows the usual autoconf rules, see 'INSTALL' for
extensive information. Since Fimex makes some floating-point calculations
in large loops, it is advisable to switch on SIMD/SSE operations in your
compiler. On a Xeon machine with a x386 machine and gcc, I use the 
following flags (those are default for x86-64)

export milib_CFLAGS=-I/disk1/metno/local/include
export milib_LIBS=-L/disk1/metno/local/lib -lmic -lmi -lg2c
CFLAGS='-O2 -mfpmath=sse -msse2' CXXFLAGS='-O2 -mfpmath=sse -msse2' ./configure --with-NetCDF-lib-dir=/usr/lib/netcdf-3 -with-NetCDF-include-dir=/usr/include/netcdf-3 --with-udunits=/usr

Testing the Installation
------------------------
Make sure to download the test-data from
https://wiki.met.no/_media/fimex/flth00.dat.gz, add it to the test/
directory and gunzip it.
Then run 'make check'. 

USAGE EXAMPLE
-------------
Converting a model output from felt to NetCDF

a) get an overview of times, layers and grid used in the felt-file
b) group the parameters so that all parameters within an group use the
   same grid, times and the same layers (its possible to have a file
   with both sigma and pressure layers, but then all sigma-variables
   should have the same number of sigma layers and all pressure-variables
   should have the same number of pressure layers. Surface only variable,
   usually sigma=1000 felt variables, are layer-group of their own)
c) create a felt2nc_variables.xml file for each variable group.
   Copy parameters from existing examples, or lookup variable and parameter
   names in the CF standard name documentation.
   If you have to generate several groups, it might be useful to
   split the file into axes, global attributes and variables, see i.e.
   damocles_felt2nc_variables.xml
   If you have two paramters which map to the same standard_name, i.e. make
   sure to give them different variable names if they are in the same group
   Adjust the datatype according to your data. float will always work fine,
   use short if you know, that the variable even fits as 4-dimensional data
   into shorts. Use eventually a cdmWriterConfig.xml to process data as float
   and write the data as short.
d) validate the felt2nc_variables.xml file, i.e. with
	xmllint --xinclude --postvalid --noout ../../share/etc/felt2nc_variables.xml
e) adjust the projection and area you want to extract in fimex_example.cfg (or 
   use command line arguments to fimex)
d) run 'fimex -c fimex_example.cfg'
